<div class="form">
<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm',array(
	'id'=>'project-form',
	'enableAjaxValidation'=>false,
        'method'=>'post',
	'type'=>'horizontal',
	'htmlOptions'=>array(
		'enctype'=>'multipart/form-data'
	)
)); ?>
     	<fieldset>
		<legend>
			<p class="note">Fields with <span class="required">*</span> are required.</p>
		</legend>

	<?php echo $form->errorSummary($model,'Opps!!!', null,array('class'=>'alert alert-error span12')); ?>
        		
   <div class="control-group">		
			<div class="span4">
	<?php if(Yii::app()->user->checkAccess('admin')){
		echo $form->dropDownListRow($model,'userId',CHtml::listData(User::model()->findAll(array('condition'=>'id > 1','order' => 'username')), 'id', 'username'),array('class'=>'form-control span3','empty'=>'--Select User--'));
		echo $form->dropDownListRow($model,'status',array(1=>'Approve',2=>'Not Yet',3=>'Not Approve'),array('class'=>'form-control span3'));
	}?>
	<?php echo $form->textFieldRow($model,'name',array('class'=>'form-control span5','maxlength'=>50)); ?>

	<?php echo $form->dropDownListRow($model,'province_id',CHtml::listData(Province::model()->findAll(), 'id', 'name'),array('class'=>'form-control span6','empty'=>'--Select Province--')); ?>
	
	<?php echo $form->textFieldRow($model,'finance_range',array('class'=>'form-control span5')); ?>

	<?php echo $form->textFieldRow($model,'partners',array('class'=>'form-control span5','maxlength'=>50)); ?>
	<?php
		if($model->isNewRecord==false){
			echo '<div class="control-group">
					<label for="Project_file_path_name" class="control-label required">Uploaded File <span class="required">*</span></label>
						<div class="controls">
							'.CHtml::link($model->file_path,Yii::app()->baseUrl."/upload/".$model->file_path).'
						</div>
					</div>';
		}
	?>
	<?php echo $form->fileFieldRow($model,'file_path',array('class'=>'span5','maxlength'=>500)); ?>


                        </div>   
  </div>

	<div class="form-actions">
		<?php $this->widget('bootstrap.widgets.TbButton', array(
			'buttonType'=>'submit',
			'type'=>'primary',
                        'icon'=>'ok white',  
			'label'=>$model->isNewRecord ? 'Create' : 'Save',
		)); ?>
              <?php $this->widget('bootstrap.widgets.TbButton', array(
			'buttonType'=>'reset',
                        'icon'=>'remove',  
			'label'=>'Reset',
		)); ?>
	</div>
</fieldset>

<?php $this->endWidget(); ?>

</div>
